fix(image): enable CORS for the documented web UI path#452
Merged
Conversation
The image ran with CORS off (no cors section -> empty allowed_origins), so the documented web-UI-next-to-gateway path failed with "Failed to fetch". Set allowed_origins: ["*"] in the Docker params; restrict origins / enable JWT auth for production. Closes #445
Contributor
There was a problem hiding this comment.
Pull request overview
Enables CORS in the Docker image’s default ROS params so the separately-hosted ros2_medkit_web_ui can call the gateway API without browser cross-origin failures, aligning the container “quick start” with the documented UI workflow.
Changes:
- Add a
corssection to the Docker default params file. - Configure
cors.allowed_originsto allow cross-origin browser requests by default.
bburda
reviewed
Jun 20, 2026
The Docker params now enable CORS (allowed_origins: ["*"]) so the web UI works out of the box; update docker.rst, which still said CORS was disabled by default, and keep the production guidance to restrict origins.
A wildcard origin with auth disabled and write methods enabled lets any site drive cross-origin POST/PUT/DELETE on a reachable gateway. Ship the default web UI origins (localhost:3000, localhost:5173) instead, so the documented UI path still works without exposing cross-origin writes.
bburda
approved these changes
Jun 21, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Docker params file has no
corssection, so the image runs with CORS off (emptyallowed_origins). The documented path of running the web UI next to the gateway then fails: the UI is a separate origin and every request returns "Failed to fetch".This sets
cors.allowed_origins: ["*"]indocker/gateway_docker_params.yaml. The gateway echoes the request origin (not a literal*) and blocks credentials+wildcard at startup;allow_credentialsdefaults false, so this is safe by default. Restrict origins / enable JWT auth for production.Verified: gateway started with this params file logs
CORS enabled - origins: [*], ... credentials: false, andcurl -H "Origin: http://localhost:3001" .../api/v1/healthreturnsAccess-Control-Allow-Origin: http://localhost:3001.Closes #445